<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>06_事件监听</title>
</head>
<body>
<button onclick="alert('点击了')">我是按钮</button>
<button id="btn">我是按钮</button>
<h4>今天星期一</h4>
<span>2020-05-05</span>
<h4>明天星期二</h4>
<script>
    window.addEventListener('resize',function (){
        console.log('resize');
    })
    let btn = document.querySelector('span');
    btn.addEventListener('mouseover',function (){
        console.log('点击了');
    })
    let btn1=document.getElementById('btn')
    btn1.addEventListener('click',function (){
        console.log('点击了');
    })
</script>
</body>
</html>